package component.base

import android.content.Context
import android.view.View
import androidx.lifecycle.LifecycleOwner
import component.vm.BaseViewModel

/**
 * 组件接口
 *  * 表示任何类型的泛型
 */
interface IComponent<T : BaseViewModel<*>> {

  fun init()

  fun context(): Context

  fun rootView(): View

  fun createVM(viewModelClass: Class<T>): T

  fun bind()

  fun unbind()

  fun setLifeCycleOwner(lifecycleOwner: LifecycleOwner)

  fun getLifeCycleOwner(): LifecycleOwner?
}